package fr.umlv.m2.jee.jsf.webflow.service.author.impl;

import fr.umlv.m2.jee.jsf.webflow.persistence.author.IAuthorDAO;
import fr.umlv.m2.jee.jsf.webflow.service.author.DisplayAuthor;
import fr.umlv.m2.jee.jsf.webflow.service.author.IDisplayAuthorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: gloyaute
 * Date: 6 nov. 2010
 * Time: 21:09:50
 * To change this template use File | Settings | File Templates.
 */
@Service("defaultDisplayAuthorService")
public class DefaultDisplayAuthorService implements IDisplayAuthorService {

    @Autowired
    private IAuthorDAO authorDAO;


    @Override
    @Transactional(readOnly=true)
    public List<DisplayAuthor> getAllDisplayAuthor() {
        ArrayList< DisplayAuthor > result = new ArrayList< DisplayAuthor >(16);

        result.add(new DisplayAuthor("Christopher", "Paolini"));
        result.add(new DisplayAuthor("Doug", "Lea"));
        result.add(new DisplayAuthor("Donald", "Knuth"));
        result.add(new DisplayAuthor("Donald", "Duck"));

        return result;
    }
}
